﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="UserRights.aspx.cs" Inherits="UserRights" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<script type="text/javascript">
    function SetChangeValue(objHidden) {
        objHidden.value = "true";}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table>
      
        <tr>
            <td>
                <asp:DropDownList ID="ddUserType" runat="server" DataSourceID="UertypeDataSource1"
                    DataTextField="UserType" DataValueField="UserTypeId" 
                    ondatabound="ddUserType_DataBound" >
                </asp:DropDownList>
                <asp:SqlDataSource ID="UertypeDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    SelectCommand="SELECT [UserTypeId], [UserType] FROM [tblUserType]"></asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td>
                <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
                    <asp:ListItem Value="2">All</asp:ListItem>
                    <asp:ListItem Value="1">Approved</asp:ListItem>
                    <asp:ListItem Value="0">Un Approved</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                <asp:TextBox ID="txtFirstName" runat="server" AutoPostBack="true"
                    ontextchanged="TextChanged1"></asp:TextBox>
                <asp:TextBox ID="txtLastName" runat="server" AutoPostBack="true" ontextchanged="TextChanged1"></asp:TextBox>
            </td>
        </tr>
        
        <tr>
            <td>
           
            <asp:DropDownList ID="ddUserId"  runat="server" DataSourceID="ListDataSource" 
                    DataTextField="Username" DataValueField="UserId" 
                    ondatabound="ddUserId_DataBound" >
                
            </asp:DropDownList>
                <asp:SqlDataSource ID="ListDataSource" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                    SelectCommand="spUserFilter" SelectCommandType="StoredProcedure" >
                    <SelectParameters>
                        
                        <asp:ControlParameter ControlID="ddUserType" DefaultValue="0" Name="UserType" 
                            PropertyName="SelectedValue" Type="Int32" />
                        <asp:ControlParameter ControlID="txtFirstName" DefaultValue=" " 
                            Name="FirstName" PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="txtLastName" DefaultValue=" " Name="LastName" 
                            PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="DropDownList1" DefaultValue="2" 
                            Name="isApproved" PropertyName="SelectedValue" Type="Byte" />
                    </SelectParameters>
                </asp:SqlDataSource>
                
                <br /><br />
                <asp:ImageButton ID="btnUpdateRecord" runat="server" ImageUrl="~/App_Themes/Startup/Images/btn_SignIn.png" />

            </td>
        </tr>
        
        <tr>
            <td>
            
                <asp:ImageButton ID="btnGenrateReport" runat="server" ImageUrl="~/App_Themes/Startup/Images/btn_SignIn.png"
                    ValidationGroup="ctl00$ctl00$Login1" CommandName="Login" 
                    onclick="LoginButton_Click" />
                <asp:ImageButton ID="Reset" OnClientClick="javascript:this.form.reset();" ImageUrl="~/App_Themes/Startup/Images/btn_Reset.png"
                    runat="server" />
            </td>
        </tr>
    </table>
</asp:Content>
